﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.ComponentModel.Design;

namespace Ajaxna.Designers
{
    [ToolboxItem(false)]
    public class ScriptsCollectionEditor : CollectionEditor
    {
        Type _type;
        public ScriptsCollectionEditor(Type type): base(type)
        {
            _type = type;
        }

        public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
        {
            return System.Drawing.Design.UITypeEditorEditStyle.Modal;
        }

        protected override bool CanSelectMultipleInstances()
        {
            return false;
        }

        protected override Type CreateCollectionItemType()
        {
            return typeof(AjaxnaScriptReference);// _type;
        }
    }
}
